;=========== RTC Defines ==================================================================
			.equ	DDR_SPI		= DDRB		; SPI Data Port
			.equ	PIN_SPI		= PINB
			.equ	PORT_SPI	= PORTB

			.equ	RTC_SEL		= 1
			.equ	RTC_MOSI	= 5
			.equ	RTC_MISO	= 6
			.equ	RTC_SCK		= 7
			.equ	RTC_INT		= 0
			.equ	RTC_SS		= 4


.MACRO		INIT_RTC

			; init SPI
			
			ldi		r17, 0xFF
			out		PORT_SPI, r17

			ldi 	r17, (1 << RTC_MOSI) | (1 << RTC_SCK) | (1 << RTC_SEL) | (1 << RTC_SS)
			out 	DDR_SPI, r17

			ldi		r17, (1 << SPE) | (1 << MSTR) | (1 << CPHA) | (1 << SPR1) | (1 << SPR0)
			out		SPCR, r17

.ENDM

